package edu.yngsxy.communityservice.sys.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import edu.yngsxy.communityservice.core.model.entity.WkBaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import jakarta.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
/**
 * <p>
 * 角色权限：给角色分配权限
 * </p>
 *
 * @author lr
 * @since 2025-09-09
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
@TableName("sys_role_permission")
@Schema(description = "角色权限：给角色分配权限")
public class SysRolePermission extends WkBaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 角色ID：字段值来源于角色表sys_role的id字段值
     */
    @TableField("role_id")
    @Schema(title = "角色ID", description = "字段值来源于角色表sys_role的id字段值", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotNull(message = "角色ID不能为空")
    private Integer roleId;

    /**
     * 权限ID：字段值来源于权限表sys_permission的id字段值
     */
    @TableField("permission_id")
    @Schema(title = "权限ID", description = "字段值来源于权限表sys_permission的id字段值", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotNull(message = "权限ID不能为空")
    private Integer permissionId;
}
